package com.example.mapsapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity implements View.OnClickListener{

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_activity);
		
		Button friend = (Button) findViewById(R.id.buttonFriend);
		friend.setOnClickListener(this);
		
		Button map = (Button) findViewById(R.id.buttonMap);
		map.setOnClickListener(this);
		
		Button map1 = (Button) findViewById(R.id.btn_Search);
		map1.setOnClickListener(this);
		Button map2 = (Button)findViewById(R.id.buttonplace);
		map2.setOnClickListener(this);
		
	}
	
	public void onClick(View v){

		switch (v.getId()){
			case R.id.buttonFriend:
				friendClick();
				break;
			case R.id.buttonMap:
				mapClick();
				break;
			case R.id.btn_Search:
				SearchClick();
				break;
			case R.id.buttonplace:
				PlaceClick();
				break;
		}
	}
	
	
	private void PlaceClick() {
		// TODO Auto-generated method stub
		Intent i = new Intent(this, SearchPlaces.class);
		startActivity(i);
	}

	private void SearchClick() {
		Intent i = new Intent(this, Find_Favorite.class);
		startActivity(i);
		
	}

	private void  friendClick(){
		Intent i = new Intent(this, Friends.class);
		startActivity(i);
	}
	
	public void favoritesClick(View v){
		Intent i = new Intent(this, Favorites.class);
		startActivity(i);
	}
	
	private void  mapClick(){
		Intent i = new Intent(this, Map.class);
		startActivity(i);
	}
}
